package cn.edu.scau.cmi.zhuangzhihong.client;

import org.springframework.context.ApplicationContext;

import cn.edu.scau.cmi.zhuangzhihong.spring.domain.Student;
import cn.edu.scau.cmi.zhuangzhihong.spring.domain.Teacher;
import cn.edu.scau.cmi.zhuangzhihong.spring.util.ApplicationContextUtil;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;

import javafx.scene.control.TextArea;

public class viewController {
	@FXML
	private TextArea text;
	
	private static Teacher liangzaoqing;
	private static Student zhuangzhihong;
	private static ApplicationContext getApplicationContext() {
		ApplicationContext applicatonContext = ApplicationContextUtil.getApplicationContext();
		zhuangzhihong=(Student) applicatonContext.getBean("zhuangzhihong");
		return applicatonContext;
	}
	
	public void show(ActionEvent action) {
	getApplicationContext();
	System.out.println(zhuangzhihong.getName()+"的毕业设计指导老师是"+zhuangzhihong.getTutor().getName());
	text.setText(zhuangzhihong.getName()+"的毕业设计指导老师是"+zhuangzhihong.getTutor().getName());
	}
}
